#pragma once
#include <vector>
#include <optional>

struct Pos { int r; int c; };

struct Grid {
    int rows;
    int cols;
    std::vector<unsigned char> cells;
    bool diagonal;
    Pos start;
    Pos goal;
    Grid(int r, int c);
    bool in_bounds(Pos p) const;
    bool is_blocked(Pos p) const;
    void set_block(Pos p, bool blocked);
    std::vector<Pos> neighbors(Pos p) const;
};

